{% extends "news_layout.html" %}

{% block btns %}
<span id="allNews" class="my-btn sidebar-item pointer">ALL NEWS</span>
<span id="allEvents" class="my-btn sidebar-item pointer">ALL EVENT</span>
{% endblock %}

{% block search %}
{% if isDetail == false %}
<div class="search">
  <p class="tip">NEWS SEARCH</p>
  <div class="input-group">
    <input type="text" class="form-control" placeholder="Search for...">
    <span class="input-group-btn">
      <button class="btn btn-default" type="button">Search</button>
    </span>
  </div>
</div>
{% endif %}
{% endblock %}

{% block archives %}
{% if isDetail == false %}
<div class="archives">
  <p class="tip">NEWS ARCHIVE</p>
  <ul>
    <li>2020</li>
    <li>2019</li>
    <li>2018</li>
    <li>2017</li>
    <li>2016</li>
  </ul>
</div>
{% endif %}
{% endblock %}

{% block others %}
{% if isDetail %}
<p class="news-detail__tip-title">TOPICS</p>
<p class="news-detail__tip-content">{{ pageData.newstype | typeMapper }}</span>
<p class="news-detail__tip-title">DATE</p>
<p class="news-detail__tip-content">{{ pageData.newsdate }}</p>
<!--<h3>SHARE</h3>-->
{% endif %}
{% endblock %}

{% block main %}
{% if isDetail %}
<div class="main news news-detail">
  <h1 class="news-detail__title">{{ pageData.newstitle }}</h1>
  {{ helper.shtml(pageData.newstext) }}
</div>
{% else %}
<div class="main news">
  {% if topInfo %}
  <div class="news__intro border-bottom-line">
<!--    <img src="{{ topInfo.picture }}" alt="">-->
    <div class="detail">
      <h2>{{ topInfo.newstitle }}</h2>
      <a href="/news?id={{ topInfo.newsid }}">
        <span class="btn">READ MORE</span>
      </a>
    </div>
  </div>
  {% endif %}
  {% for new in pageData.rows %}
  <a href="/news?id={{ new.newsid }}">
    <section class="new border-bottom-line">
      <div class="desc">
        <p class="type">{{ new.newstype | typeMapper }}</p>
        <h3>{{ new.newstitle }}</h3>
        <span>{{ new.newsdate | timeEnFilter }}</span>
      </div>
<!--      <img src="{{new.picture}}" alt="picture">-->
    </section>
  </a>

  {% else %}
  <p>暂无内容</p>
  {% endfor %}
  <!--<section class="new border-bottom-line">-->
  <!--<div class="desc">-->
  <!--<p class="type">RESEARCH NEWS</p>-->
  <!--<h3>Chem received a new paper Chem received a new paper</h3>-->
  <!--<span>10 MAR 2020</span>-->
  <!--</div>-->
  <!--<img src="../public/img/new_item.png" alt="">-->
  <!--</section>-->
  {% include "components/pagination.html" %}
</div>
{% endif %}
{% endblock %}
